From: Benjamin Otte Date: Thu, 5 Jan 2023 20:05:24 +0000 (+0100) Subject: filedialog: Never set the chooser's file X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~116^2^2~96^2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=446e6a8d6200b7f71bf3d8170448fa859771e25d;p=gtk4.git filedialog: Never set the chooser's file Instead, get by with setting the name and hope the filechooser figures things out by itself. Fixes #5496 --- diff --git a/gtk/gtkfiledialog.c b/gtk/gtkfiledialog.c index 6f1a0dada2..6cf4f6bb0b 100644 --- a/gtk/gtkfiledialog.c +++ b/gtk/gtkfiledialog.c @@ -959,9 +959,7 @@ create_file_chooser (GtkFileDialog *self, file_chooser_set_shortcut_folders (GTK_FILE_CHOOSER (chooser), self->shortcut_folders); if (self->initial_folder) gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (chooser), self->initial_folder, NULL); - if (self->initial_file) - gtk_file_chooser_set_file (GTK_FILE_CHOOSER (chooser), self->initial_file, NULL); - else if (self->initial_name) + if (self->initial_name && action == GTK_FILE_CHOOSER_ACTION_SAVE) gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (chooser), self->initial_name); return chooser;